package com.bwie.auth.remote.factory;

import com.bwie.auth.remote.SysUserRemoteService;
import com.bwie.common.doamin.dto.LoginDTO;
import com.bwie.common.doamin.dto.RegisterDTO;
import com.bwie.common.doamin.model.SysUser;
import com.bwie.common.doamin.vo.LoginVO;
import com.bwie.common.result.Result;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 用户远程调用工厂
 *
 * @author <a href="mailto:2943147140@qq.com">刘洋朔</a>
 * @version 1.0
 * @description: 用户远程调用工厂
 * @date 2025/9/9 10:55
 */
@Component
public class SysUserRemoteFactoryService implements FallbackFactory<SysUserRemoteService> {
    @Override
    public SysUserRemoteService create(Throwable cause) {
        return new SysUserRemoteService() {
            @Override
            public Result<SysUser> selLoginInfo(LoginDTO loginDTO) {
                return Result.error("服务器繁忙，请稍后重试");
            }

            @Override
            public Result<Void> register(RegisterDTO registerDTO) {
                return Result.error("服务器繁忙，请稍后重试");
            }

            @Override
            public Result<Long> selRoleByUserId(Long userId) {
                return Result.error("服务器繁忙，请稍后重试");
            }
        };
    }
}
